add babl_format_get_model
authorØyvind Kolås <pippin@gimp.org>
Wed, 25 Apr 2012 23:17:41 +0000 (01:17 +0200)
committerØyvind Kolås <pippin@gimp.org>
Wed, 25 Apr 2012 23:17:41 +0000 (01:17 +0200)
babl/babl-format.c
babl/babl.h

index 7f43911f2f7be6d9e34d5b21f914f475bbf9a582..0a7a840409fb64ce73f2568569b8d586dd09015c 100644 (file)
@@ -653,4 +653,16 @@ babl_set_user_data (const Babl *cbabl, void *data)
     }
 }
 
+const Babl *
+babl_format_get_model (const Babl *format)
+{
+  if (format->class_type == BABL_FORMAT)
+    {
+      return (Babl*)format->format.model;
+    }
+  return NULL;
+}
+
 BABL_CLASS_IMPLEMENT (format)
+
+
index 5e6cf42ff787bec3eb5ee9b1b406070d4481c95f..c1c5e9dbb6b237c68fdab03cbbb67fe18f3d8eef 100644 (file)
@@ -104,6 +104,11 @@ int          babl_format_has_alpha             (const Babl *format);
  */
 int          babl_format_get_bytes_per_pixel   (const Babl *format);
 
+/**
+ * Return the model used for constructing the format.
+ */
+const Babl * babl_format_get_model             (const Babl *format);
+
 /**
  * Returns the number of components for the given @format.
  */